﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ModelRecordReport.aspx.cs"
    Inherits="FX.CC.Andon.WebSite.ReportManage.ModelRecordReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>换模记录报表</title>
    <script src="../lib/boot.js" type="text/javascript"></script>
</head>
<body>
    <div class="mini-toolbar" style="padding: 2px; border-bottom: 0;">
        <table>
            <tr>
                <td align="right">
                    日期：
                </td>
                <td style="width: 150px;" align="left">
                    <input id="BizDateFrom" style="width: 150px;" class="mini-datepicker" format="yyyy-MM-dd" />
                </td>
                <td align="right">
                    至：
                </td>
                <td style="width: 150px;" align="left">
                    <input id="BizDateEnd" style="width: 150px;" class="mini-datepicker" format="yyyy-MM-dd" />
                </td>
                <td style="width: 100px">
                    <a class="mini-button" iconcls="icon-search" onclick="search()">查 询</a>
                </td>
            </tr>
            <tr>
                <td align="right">
                    产品：
                </td>
                <td style="width: 150px;" align="left">
                    <div id="PrdID" name="PrdID" class="mini-combobox" onvaluechanged="onLineIDChanged"
                        style="width: 150px;" popupwidth="400" textfield="PrdName" valuefield="PrdID"
                        url="../Service/BasicDataManageHandler.ashx?action=GetProductListByCombobox">
                        <div property="columns">
                            <div header="产品编号" field="PrdCode" width="40%">
                            </div>
                            <div header="产品名称" field="PrdName" width="60%">
                            </div>
                        </div>
                    </div>
                </td>
                <td align="right">
                    工序：
                </td>
                <td style="width: 150px;" align="left">
                    <div id="FlowID" name="FlowID" class="mini-combobox" style="width: 150px;" textfield="ProcessIdx"
                        valuefield="FlowID">
                    </div>
                </td>
                <td style="width: 100px">
                    <a class="mini-button" iconcls="icon-reset" onclick="reset()">重 置</a>
                </td>
            </tr>
        </table>
    </div>
    <!--撑满页面-->
    <div class="mini-fit">
        <div id="grid1" class="mini-datagrid" style="width: 100%; height: 100%;" idfield="RecID"
            sizelist="[10,20,50,100]" pagesize="20">
            <div property="columns">
                <div type="indexcolumn">
                </div>
                <div field="PrdCode" width="100" headeralign="center" allowsort="true">
                    产品编号
                </div>
                <div field="PrdName" width="140" headeralign="center" allowsort="true">
                    产品名称
                </div>
                <div field="ProcessIdx" width="100" headeralign="center" allowsort="true">
                    工序
                </div>
                <div field="BizDate" width="120" headeralign="center" dateformat="yyyy-MM-dd" allowsort="true">
                    日期
                </div>
                <div field="StartTime" width="120" headeralign="center" allowsort="true" dateformat="yyyy-MM-dd HH:mm:ss">
                    换模开始时间
                </div>
                <div field="EndTime" width="120" headeralign="center" allowsort="true" dateformat="yyyy-MM-dd HH:mm:ss">
                    换模结束时间
                </div>
                <div field="ElapsedTime" width="120" headeralign="center" allowsort="true">
                    换模时长
                </div>
                <div field="ModelMin" width="120" headeralign="center" allowsort="true">
                    标准换模时长
                </div>
                <div field="TimeDifferenceValue" width="100" headeralign="center" allowsort="true">
                    差值
                </div>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    mini.parse();
    var now = new Date();
    var nowYear = now.getFullYear();
    var nowMonth = now.getMonth();
    var bizDateFrom = mini.get("BizDateFrom");
    bizDateFrom.setValue(new Date(nowYear, nowMonth, 1));
    var bizDateEnd = mini.get("BizDateEnd");
    bizDateEnd.setValue(new Date());
    var FlowID = mini.get("FlowID");
    var grid = mini.get("grid1");
    grid.setUrl("../service/ReportManageHandler.ashx?action=GetModelRecordReportList");
    grid.load({ BizDateFrom: bizDateFrom.getFormValue(), BizDateEnd: bizDateEnd.getFormValue() });
    function onLineIDChanged(e) {
        if (e.value) {
            FlowID.setUrl("../Service/BasicDataManageHandler.ashx?action=GetFlowListByCombobox&PrdID=" + e.value);
        }
    }
    function search() {
        var BizDateFrom = mini.get("BizDateFrom").getFormValue();
        var BizDateEnd = mini.get("BizDateEnd").getFormValue();
        var PrdID = mini.get("PrdID").getValue();
        var FlowID = mini.get("FlowID").getValue();
        grid.load({ BizDateFrom: BizDateFrom, BizDateEnd: BizDateEnd, PrdID: PrdID, FlowID: FlowID });
    }

    //回车键事件
    function onKeyEnter() {
        search();
    }
    function reset() {
        bizDateFrom.setValue(new Date(nowYear, nowMonth, 1));
        bizDateEnd.setValue(new Date());
        mini.get("PrdID").setValue("");
        mini.get("FlowID").setData("[]");
        mini.get("FlowID").setValue("");
    }

    function CloseWindow(action) {
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();
    }
    function close() {
        CloseWindow("close");
    }
</script>
